package com.chuangke.system.service;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.chuangke.system.entity.SysRelationGraph;

import java.util.List;
import java.util.function.Predicate;

public interface SysRelationGraphService {

	void save(List<SysRelationGraph> records);

	void deleteByIds(List<String> ids);
	
	void deleteByObjectId(List<String> objectIds) ;

	void delete(Wrapper<SysRelationGraph> queryWrapper) ;

	List<SysRelationGraph> findList();

	List<SysRelationGraph> findListByTargetId(List<String> ids);

	List<SysRelationGraph> findListBySourceId(List<String> ids);

	/**
	 * 加载对象的所有血缘关系
	 * @param objectId
	 * @return
	 */
	List<SysRelationGraph> findDeepRelationByObjectId(String objectId, Predicate predicate);
	
	/**
	 * 查找直接血缘关系(只显示上一代和下一代)
	 * @param objectId
	 * @return
	 */
	List<SysRelationGraph> findDirectRelationByObjectId(String objectId, Predicate predicate);

	/**
	 * 查找直接血缘关系（所有的直系关系）
	 * @param objectId
	 * @return
	 */
	List<SysRelationGraph> findDirectDeepRelationByObjectId(String objectId, Predicate predicate);
	
}
